package dev.guide;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import dev.guide.gif.GIFDemoActivity;
import dev.guide.multithread.MultithreadActivity;
import dev.guide.net.NetworkActivity;
import dev.guide.userguide.UserGuideActivity;

public class MainActivity extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		findViewById(R.id.button_network).setOnClickListener(this);
		findViewById(R.id.button_gif_demo).setOnClickListener(this);
		findViewById(R.id.button_multithread).setOnClickListener(this);
		findViewById(R.id.button_userguide).setOnClickListener(this);
	}

	@Override
	protected void onDestroy() {
		// TODO Auto-generated method stub
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		// TODO Auto-generated method stub
		super.onPause();
	}

	@Override
	protected void onRestart() {
		// TODO Auto-generated method stub
		super.onRestart();
	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onRestoreInstanceState(savedInstanceState);
	}

	@Override
	protected void onResume() {
		// TODO Auto-generated method stub
		super.onResume();
	}

	@Override
	protected void onSaveInstanceState(Bundle outState) {
		// TODO Auto-generated method stub
		super.onSaveInstanceState(outState);
	}

	@Override
	protected void onStart() {
		// TODO Auto-generated method stub
		super.onStart();
	}

	@Override
	protected void onStop() {
		// TODO Auto-generated method stub
		super.onStop();
	}

	@Override
	public void onClick(View v) {
		Intent intent = new Intent();
		switch(v.getId()) {
		case R.id.button_network:
			intent.setClass(this, NetworkActivity.class);
			break;
		case R.id.button_gif_demo:
			intent.setClass(this, GIFDemoActivity.class);
			break;
		case R.id.button_multithread:
			intent.setClass(this, MultithreadActivity.class);
			break;
		case R.id.button_userguide:
			intent.setClass(this, UserGuideActivity.class);
			break;
		}
		startActivity(intent);
	}

}
